/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: jse2302 - File2
 * <p>Powered by webrx On 2023-06-26 17:16:56
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class File2 {
    public static void main(String[] args) throws Exception {
        //读取文件
        String file = "D:\\0531\\javase\\jse2302\\ch09\\src\\cn\\webrx\\FileDemo.java";

        System.out.println(FileUtils.getFileRows(file));

        String fn = "D:\\0531\\javase\\jse2302\\ch01\\src\\cn\\webrx\\Hello.java";
        System.out.printf("文件：%s，有 \33[31m%d\33[0m 行代码。", fn, FileUtils.getFileRows(fn));

        //FileInputStream fis = new FileInputStream(file);
        //String txt = new String(fis.readAllBytes());
        //System.out.println(txt.lines().count());
        //System.out.println("-------------------------------");
        //System.out.println(txt);

    }
}
